package com.kukudexin.base01.reentrantLock.base;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

/**
 * @author: 酷酷的鑫
 * @Date: 2022/1/27 10:43
 * @description:
 */
public class MyLockTest01 {
    public synchronized void sm1(){
        System.out.println("同步sm1方法");
        sm2();
    }

    private synchronized void sm2() {
        System.out.println("同步sm2方法");
        sm3();
    }

    private synchronized void sm3() {
        System.out.println("同步sm3方法");
    }

    public static void main(String[] args) {
        MyLockTest01 obj = new MyLockTest01();
        Thread thread = new Thread(() -> {
            System.out.println("t1");
        });

        ExecutorService executorService = Executors.newCachedThreadPool();
        executorService.submit(thread);
    }

}
